﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using GrayParrot.Configuration;
using GrayParrot.Caching.Configuration;

namespace GrayParrot.Caching
{
    public static class CacheSettingsExtension
    {
        public static ExpirationPeriod GetExpirationPeriod(this IConfigurationManagerHelper value)
        {
            ExpirationPeriod retValue = ExpirationPeriod.None;

            CacheSettings cfg = CacheSettings.GetConfiguration(@"GrayParrotGroup/CacheSettings");
            retValue = cfg.ExpirationPeriod;

            return retValue;
        }

        public static int GetExpirationTime(this IConfigurationManagerHelper value)
        {
            int retValue = 0;

            CacheSettings cfg = CacheSettings.GetConfiguration(@"GrayParrotGroup/CacheSettings");
            retValue = cfg.ExpirationTime;

            return retValue;
        }
    }
}
